package cloud.maque.sso.server.service.impl;

import cloud.maque.sso.server.conf.MockEnabledCondition;
import cloud.maque.sso.server.service.PhoneHandle;
import cn.dev33.satoken.util.SaFoxUtil;
import org.springframework.context.annotation.Conditional;
import org.springframework.stereotype.Service;

@Service
@Conditional(MockEnabledCondition.class)
public class PhoneMockHandleImpl implements PhoneHandle {
    @Override
    public String sendCode(String phone) {
        String code = SaFoxUtil.getRandomNumber(100000, 999999) + "";
        System.out.println("手机号：" + phone + "，验证码：" + code + "，已发送成功");
        return code;
    }
}
